package com.hzh.page.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hzh.page.common.valid.AddValidGroup;
import com.hzh.page.common.valid.UpdateValidGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author chenzw
 * @date 2022-11-03
 */
@Data
@TableName("authentication_user")
public class AuthenticationUser implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @ApiModelProperty(value = "用户ID")
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 用户名
     */
    @NotNull(message = "用户名不能为空", groups = AddValidGroup.class)
    @ApiModelProperty(value = "用户名")
    private String userName;

    /**
     * 密码
     */
    @ApiModelProperty(value = "密码")
    @Pattern(regexp = "^[\\w]{6,16}$", message = "请输入6~16位，包含大小写字母和数字的组合", groups = {AddValidGroup.class, UpdateValidGroup.class})
    private String passWord;

    /**
     * 用户状态
     */
    @ApiModelProperty(value = "用户状态")
    private Boolean roleState;
    @ApiModelProperty(value = "是否默认角色")
    private Boolean defaultUser;
    @ApiModelProperty(value = "地区ID")
    private Integer regionId;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;
}


